package com.haifeng.jupiter.common.log.event;

import com.haifeng.jupiter.common.log.entity.GlobalLogEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * <p>
 *  全局操作日志监听
 * </p>
 *
 * @author: Haifeng
 * @date: 2020-08-09
 */
@Slf4j
@Component
public class GlobalLogListener {

	@Async
	@EventListener(GlobalLogEvent.class)
	public void saveSysLog(GlobalLogEvent event) {
		GlobalLogEntity globalLogEntity = event.getGlobalLogEntity();
		log.info("[全局操作日志]：{}", globalLogEntity);
	}

}
